package cn.bx.bid.repository;

import cn.bx.bid.entity.Professor;
import cn.bx.bid.entity.Project;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface ProjectRepository extends JpaRepository<Project,Long>, JpaSpecificationExecutor<Project> {

//修改项目
@Modifying
@Query( "update Project set isEvaluated=?2 where id=?1" )
    public int updateProjectState(long id,String isEvaluated);
    //设置中标企业信息，并修改项目状态为5,
    @Modifying
    @Query("update Project set dealCompany=?2,settlePrice=?3,isEvaluated='5',status=1  where id=?1")
    public int settleProject(long projid, String dealCompany, double settlePrice);

}
